In modern browsers, rendering of documents such as for instance World Wide Web (WWW) documents formatted according to the Hypertext Markup Language (HTML) or derivatives thereof (such as for instance the Extensible HTML (XHTML)), is frequently based on the Cascading Style Sheets (CSS) processing model, for instance the CSS level 2 (CSS2) processing model (cf. Cascading Style Sheets, level 2 revision 1 CSS 2.1 Specification, W3C Candidate Recommendation, 25 Feb. 2004, available at www.w3.org). Style sheets represent a set of statements that specify the presentation of a document. For instance, a style sheet may uniformly define the background colour of all pages of a web document that is specified in HTML. In the CSS processing model, a user agent, for instance a browser or a part thereof, first parses a document that is to be displayed and creates a document tree that hierarchically contains the elements of said document. The user agent then identifies the target media type on which the document is to be rendered, for instance a display of a hand-held multimedia device, and retrieves style sheets associated with the document and specified for the target multimedia device. The elements in the document tree are then annotated by assigning values to properties of the respective elements that are applicable to the target media type. From the annotated document tree a formatting structure is generated in a formatting process that obeys a formatting model, for instance a visual formatting model in case of the target media type being a display. Therein, for the elements in the document tree, zero or more rectangular boxes are generated according to a CSS box model, and these boxes are then laid out according to the visual formatting model to obtain the formatting structure.
The visual formatting function that performs the formatting according to said formatting model takes as an input various internal constraints imposed by the structure and style of the document that is being processed and external constraints imposed by the browser application and environment.
Internal constraints often limit the minimum width of the boxes that make up the generated layout. For example, if a box contains an image, it cannot be narrower than the image. Similarly, if the document sets a table column to some fixed pixel width, it cannot become any narrower or wider than the specified value. Ignoring any of these constraints is a violation against the formatting model and will distort or destroy the document layout.
Currently, the most important external constraint for the formatting function is the width of the browser view port (on a desktop browser, the width of the browser window; on a mobile browser, the width of the available display area, i.e. the width of the display minus UI elements like window borders). The formatting function tries to make the formatting structure width match the view port width while still satisfying the internal constraints. If that is not possible, the formatting structure becomes wider (or narrower) than the view port width. In this case viewing the whole content of the document on a display might require sideways scrolling.
The text content of a box is formatted after the box width is determined. Still the text content provides constraints to the box width. Minimum width of a box containing text is the width of the longest word in the box. The box height, and eventually the total height of the formatting structure, is determined by the formatted height of the text content. Width and height of individual pieces of text depends on the used font and must be known during the formatting process.
Finally, said formatting structure is transferred to the target medium, for instance painted on a display. Therein, the “canvas” denotes the space where the formatting structure (with a certain area) is painted. The painting step can be repeated without reformatting the document, for example when the view position changes as a result of a user scrolling the displayed formatting structure. However, re-formatting may be required when the dimensions of the view port are changed by a user.
The view ports of hand-held multimedia devices such as mobile phones or Personal Digital Assistants (PDAs) are necessarily significantly smaller than the view ports of the computer or television screens for which documents are usually designed. If for instance content of the World Wide Web (WWW), i.e. web documents formatted, for example, in HTML or XHTML, is to be displayed on the display of a hand-held device, it has to be considered that these web documents normally have an original presentation size designed for portrayal on a computer monitor, the dimensions of which are often remarkably larger than the display of a hand-held device such as a mobile phone. As an example, the width of the display of a computer monitor is generally 800 picture elements (pixels) or more, whereas the display area on a typical hand-held multimedia device (such as for instance one of the Nokia Series 60 devices) is only 176×208 pixels.
In prior art, various methods have been developed that reformat the web document content to better fit the width of small view ports. For instance, US 2004/0049737 A1 proposes to format the web document content to selectively minimize the horizontal scrolling required to view the content on a small display. Each component or sub-component of the original area, such as a frame, table row, table cell or nested table is considered separately and may be preserved, resized or replaced. Where the context requires that the content be wider than the view port width of the display, horizontal scrolling is preserved.
This prior art approach leads to a reformatting of the entire content of the web document into a tall column (even when the original content contained more than one column) that substantially fits the width of the view port and thus requires less or no horizontal scrolling. Only components of the web document that can not be appropriately fitted to the view port width exceed said view port width and then require horizontal scrolling. The original design intent of the web document is thus destroyed and made unrecognizable to the user.
Improved methods for formatting large web documents to fit small displays should target to maintain the original document layout while making some adjustments to better fit it to the small view port. In particular, readability of text passages should be improved. Therein, some or all of the following design rules could be considered:                On the small display, substantially keep the original document layout so that the document looks generally similar to how it looks on a large display. This allows the user to navigate by location of the information on the page, which is essential also on a Personal Computer (PC).        Reduce the size of the document area so that less scrolling is needed to traverse the document.        Format larger text paragraphs so that as little as possible horizontal scrolling is required during their reading.        